// 
//  KNEncoding.h
//

#import <Foundation/Foundation.h>

/**
 * 编码帮助类
 */
@interface KNEncoding : NSObject

#pragma mark - base64
///base64 编码
+ (NSString *)base64EncodeString:(NSString *)string;

///base64 解码
+ (NSString *)base64DecodeString:(NSString *)string;

///base64 解码
+ (NSData *)base64DecodeData:(NSString *)string;
#pragma mark - 编码

/**
 * NSData 转 NSString
 */
+ (NSString *)utf8String:(NSData *)data;

/**
 * NSString 转 NSData
 */
+ (NSData *)dataWithUTF8:(NSString *)utf8String;

+ (NSData *)dataWithASCII:(NSString *)utf8String;

/**
 * 字符串转换为十六进制的。
 */
+ (NSString *)hexStringFromString:(NSString *)string;



#pragma mark - MD5

/**
 * MD5
 */
+ (NSString *)md5WithStr:(NSString *)str;



#pragma mark - 汉字转拼音
/**
 * 汉字转拼音
 */
+ (NSString *)transformPinyin:(NSString *)chinese;
@end
